package com.ccz.demo.design.singleton;

/**
 * 懒汉模式
 * 第一次调用时，创建对象
 * @ClassName Single
 * @Author caihaoyun
 * @Date 2020/7/6
 * @Version V1.0
 **/
public class Single {

    private static Single instance;

    private Single(){};

    public static Single getInstance() {
        if (instance == null) {
            instance = new Single();
        }
        return instance;
    }
}
